﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WUCIndexSearch.ascx.cs"
    Inherits="NJL.Web.Controls.WUCIndexSearch" %>
<%@ Import Namespace="Royalsoft.Common" %>
<script type="text/javascript">
    $(document).ready(function () {
        if ($('#<%=ddlCity.ClientID%>').val() != "") {
            $('#<%= ddlArea.ClientID%>').show();
        }
        $('#<%=ddlCity.ClientID%>').change(function () {
            if ($('#<%=ddlCity.ClientID%>').val() != "") {
                $('#<%= ddlArea.ClientID%>').show();
                $.ajax({
                    type: 'get',
                    url: '/Handle/Handler.ashx',
                    data: 'getAreaId=' + $('#<%=ddlCity.ClientID%>').val(),
                    dataType: 'text',
                    success: function (msg) {
                        document.getElementById("<%=ddlArea.ClientID %>").options.length = 0;
                        if (msg != "false") {
                            var json = eval('(' + msg + ')');
                            var ddlCity = document.getElementById("<%=ddlCity.ClientID%>");
                            var item = null;
                            document.getElementById("<%=ddlArea.ClientID %>").options.add(new Option('--请选择--', ''));
                            for (var i = 0; i < json.length; i++) {
                                item = new Option(json[i].AreaName, '' + json[i].AreaID);
                                document.getElementById("<%=ddlArea.ClientID %>").options.add(item);

                            }

                        }
                        else {
                            document.getElementById("<%=ddlArea.ClientID %>").options.add(new Option('--请选择--', ''));
                        }
                    },
                    error: function () {

                    }
                });
            }
            else {
                $('#<%= ddlArea.ClientID%>').hide();
            }
        });
        $('#<%=ddlArea.ClientID%>').change(function () {
            $('#<%=hidAreaID.ClientID %>').val($('#<%=ddlArea.ClientID %>').val());
        });
    });
    function fCheckSearch() {

        var hiddenId = '', count = 0;
        var checkbox = $("input[type=checkbox]");
        for (var i = 0; i < checkbox.length; i++) {
            if (checkbox[i].checked == true) {
                hiddenId += checkbox[i].value + ",";
                count++;
            }
        }
        //不检查是否选择服务类型了
        return true;

        if (count == 0) {
            alert('请选择要玩什么？至少选择一个哦！');
            return false;
        }

    }

    function fClearInput() {
        if ($('#<%=txtKeywords.ClientID %>').val() == '试试输入你喜欢的活动，快速找到最好玩的！') {
            $('#<%=txtKeywords.ClientID %>').val('');
        }
    }
    function fLoadInput() {
        if ($('#<%=txtKeywords.ClientID %>').val() == '') {
            $('#<%=txtKeywords.ClientID %>').val('试试输入你喜欢的活动，快速找到最好玩的！');
        }
    }
</script>
<asp:HiddenField ID="hidAreaID" runat="server" />
<div class="cont indexSearch" style="display: block">
    <!--地区选择-->
    <div class="f_right areahot" style="width: 238px;">
        <p class="centeralign tithot">
            <strong class="font14">热门地区</strong></p>
        <p class="m-top-10">
            <asp:Repeater ID="rptArea" runat="server">
                <ItemTemplate>
                    <span><a class="tag<%#Eval("ID").ToString().Substring(18,1) %>" target="_blank" title="<%#Eval("CUSTOM_AREA_NAME") %>" href="/SearchList.aspx?cc=<%#GetAreaNamePinYin(Eval("CITY_CODE").ToString())%>&AreaID=<%#Eval("ID") %>">
                        <%#Eval("CUSTOM_AREA_NAME").ToString().Length > 4 ? Eval("CUSTOM_AREA_NAME").ToString().Substring(0, 4) + "." : Eval("CUSTOM_AREA_NAME")%></a></span>
                </ItemTemplate>
            </asp:Repeater>
        </p>
        <p class="phoneindex">
            地区免费加入<span class="phonedig"><%=Tel%></span></p>
    </div>
    <div class="leftside" style="width: 700px; overflow: hidden;">
        <!--你想玩什么-->
        <div>
            <div class="index_title">
                <h2>
                    <img src="/Images/title_02.jpg" alt="您想玩什么？" /></h2>
                <span class="index_pop float_r"><s class="pop_l"></s><a target="_blank" href="/Play.aspx">
                    不知道去哪里玩？看看别人都在玩啥~现在就去找</a> <s class="pop_r"></s></span><span class="orange">商户免费加入在线咨询
                        <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<%=ContactQQ %>&site=qq&menu=yes">
                            <img border="0" src="http://wpa.qq.com/pa?p=2:<%=ContactQQ%>:47" alt="点击这里给我发消息"
                                title="点击这里给我发消息">
                        </a></span>
            </div>
            <div class="playlist">
                <div style="float: left; width: 75px">
                    <p>
                        <strong>景区活动</strong></p>
                    <p>
                        <strong>娱乐设施</strong></p>
                    <p>
                        <strong>服务项目</strong></p>
                </div>
                <div style="float: left; width: 600px">
                    <p>
                        <asp:CheckBoxList ID="cblServiceType" runat="server" RepeatDirection="Horizontal"
                            Width="100%" RepeatLayout="Flow" RepeatColumns="7">
                        </asp:CheckBoxList>
                    </p>
                </div>
                <div>
                    <div class="searchbox f_right">
                        <asp:TextBox ID="txtKeywords" Text="试试输入你喜欢的活动，快速找到最好玩的！" runat="server" CssClass="input f_left"
                            MaxLength="40" size="" Width="575px" onblur="fLoadInput()" onfocus="fClearInput()" />
                        <asp:Button ID="ibtnSearch" runat="server" CssClass="search" OnClientClick="return fCheckSearch();"
                            OnClick="ibtnSearch_Click" />
                    </div>
                    <div class="playlist" style="display:none">
                        <p>
                            <strong>区域选择</strong>
                            <asp:DropDownList ID="ddlCity" runat="server">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlArea" runat="server" Style="display: none">
                            </asp:DropDownList>
                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="cleanFlex" style="height: 1px; overflow: hidden;">
    </div>
</div>
